﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AntiObesity.Base
{
    public static class Calculator
    {
        public static float BMR(User user, float weight, float height)
        {
            if (user.Sex == false) // Male
            {
                return (float)(66 + (13.7 * weight) + (5 * height) - (6.8 * user.Age));
            }
            else
            {
                return (float)(655 + (9.6 * weight) + (1.8 * height) - (4.7 * user.Age));
            }
        }

        public static float BMI(float weight, float height)
        {
            return 10000 * weight / (height * height);
        }

        public static string Interpretation(float bmi)
        {
            if (bmi < 18.5)
                return "Underweight";
            if (bmi < 24.9)
                return "Normal";
            if (bmi < 29.9)
                return "Overweight";
            return "Obese";
        }

    }
}
